package com.africanmoviesmobile.ui;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

import com.africanmoviesmobile.R;

public class VideoPlayer extends Activity {

	public static final String EXTRA_VIDEO_URL = "video_url";
	
	private VideoView mVideoView;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);  
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        
        setContentView(R.layout.videoview);
        
        mVideoView = (VideoView) findViewById(R.id.surface_view);
        mVideoView.setVideoURI(Uri.parse(getIntent().getStringExtra(EXTRA_VIDEO_URL)));
        mVideoView.setMediaController(new MediaController(this));
        mVideoView.requestFocus();
        mVideoView.start();
        
    }
	
}
